package com.itany.reflex;

import java.io.Serializable;

/**
 * Author:石小俊
 * Date: 2022/11/2 10:31
 */
public class Student extends Person implements Serializable {
    public String no;
    private String major;

    @Override
    public String toString() {
        return "Student{" +
                "no='" + no + '\'' +
                ", major='" + major + '\'' +
                '}';
    }

    public Student() {
        System.out.println("调用无参构造");
    }

    private Student(String major) {
        this.major = major;
        System.out.println("调用由private修饰的有参构造");
    }
    public Student(String no,String major) {
        this.no = no;
        this.major = major;
        System.out.println("调用由public修饰的有参构造");
    }

    public int add(int i, int j){
        return i+j;
    }

    private double add(double i, double j){
        return i+j;
    }
}

